package javabase.schoolwork.day6_1to3;

import java.util.ArrayList;
import java.util.List;

/**
 * @author fance
 * @date 2018/5/24 19:40
 */
public  class Bank {
    public String name;
    public long customerNums;
    public List<Account> accounts = new ArrayList<>();
    public void init() {
        for (int i = 0; i < 10; i++) {
            this.accounts.add(new Account(String.valueOf(i),String.valueOf(i + 1),100));
        }
    }

    public Bank(String name) {
        this.name = name;
    }

    public Bank() {
    }

    public Bank(String name, long customerNums, List<Account> accounts) {
        this.name = name;
        this.customerNums = customerNums;
        this.accounts = accounts;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getCustomerNums() {
        return customerNums;
    }

    public void setCustomerNums(long customerNums) {
        this.customerNums = customerNums;
    }

    public List<Account> getAccounts() {
        return accounts;
    }

    public void setAccounts(List<Account> accounts) {
        this.accounts = accounts;
    }

    public void addAccount(Account account) {
        this.accounts.add(account);
    }
    public void delAccount(Account account) {
        this.accounts.remove(account);
    }


    @Override
    public String toString() {
        return "Bank{" +
                "name='" + name + '\'' +
                ", customerNums=" + customerNums +
                ", accounts=" + accounts +
                '}';
    }
}
